package com.auto.sns.knowledge.dao.impl;

import java.util.List;
import java.util.Map;

import com.system.common.Page;
import com.auto.sns.knowledge.domain.SnsKnowledgeDocument;
import com.auto.sns.knowledge.dao.ISnsKnowledgeDocumentDAO;
import com.system.util.PersistUtil;
import com.auto.sns.knowledge.sql.sqlid.SnsKnowledgeDocumentSqlID;
/**
 * : t_auto_sns_knowledge_document
 * 
 * 
 * @author Gen
 */
public class SnsKnowledgeDocumentDAOImpl implements ISnsKnowledgeDocumentDAO{

	public SnsKnowledgeDocument insertSnsKnowledgeDocument(SnsKnowledgeDocument bean){
		return PersistUtil.insert(bean, SnsKnowledgeDocumentSqlID.INSERT);
	}

	public boolean deleteSnsKnowledgeDocument(String skdoGuid){
		PersistUtil.delete(skdoGuid, SnsKnowledgeDocumentSqlID.DELETE);
		return true;
	}	

	public SnsKnowledgeDocument updateSnsKnowledgeDocument(SnsKnowledgeDocument bean){
		return PersistUtil.update(bean, SnsKnowledgeDocumentSqlID.UPDATE);
	}	

	public SnsKnowledgeDocument loadSnsKnowledgeDocument(String skdoGuid){
		return PersistUtil.query(new SnsKnowledgeDocument().getClass(), skdoGuid);
	}

	public List<SnsKnowledgeDocument> queryList(Map<String,Object> param,Page page){
		page.setCount(PersistUtil.countSpecial(param, SnsKnowledgeDocumentSqlID.QUERY));
		return PersistUtil.querySpecial(param, SnsKnowledgeDocumentSqlID.QUERY, page.getFullOrderBy(), page.getOffset(), page.getLimit());
	}

}
